import { _decorator, Component, Node } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('DataMgr')
export class DataMgr extends Component {
    public static Instance: DataMgr = null;
    onLoad(): void {
        if (DataMgr.Instance === null) {
            DataMgr.Instance = this;
        } else {
            this.destroy();
            return;
        }
    }

    public SetAccountInfo(acc: string, pwd: string) {
        localStorage.setItem("account", acc)
        localStorage.setItem("password", pwd)
    }
    public GetAccountInfo(): [string | null, string | null] {
        let acc = localStorage.getItem("account")
        let pwd = localStorage.getItem("password")
        return [acc, pwd]
    }

    start() {

    }

    update(deltaTime: number) {

    }

}


